// 不带头节点的头插法
#include <stdio.h>
#include <stdlib.h>

typedef struct Node
{
    /* data */
    int data;
    struct Node *next;
} Node, *LinkList;

LinkList HeadInsert(LinkList &L)
{
    int x;
    L = NULL;
    scanf("%d", &x);
    while (x != -1)
    {
        Node *s = (Node *)malloc(sizeof(Node));
        s->data = x;
        s->next = L;
        L = s;
        scanf("%d", &x);
    }
    return L;
}

int main()
{
    LinkList L;
    HeadInsert(L);
    return 0;
}